using System;
using System.Collections.Generic;
using System.ComponentModel;
using Iesi.Collections;
using Iesi.Collections.Generic;
using METODESA.Server.Data.Components;
using METODESA.Server.Data.Exceptions;
using METODESA.Server.Data.METODESA.Entity;

namespace METODESA.Server.Data.METODESA.Entity 
{    
	/// <summary>
	/// An object representation of the Empleado table
	/// </summary>
	[Serializable]
	public partial class Empleado
	{
		private System.Int32 _Id;

		private System.String _Apellido;
		private System.String _Cedula;
		private System.String _Direccion;
		private  ISet<OrdenCompra> _OrdenCompra;
		private  ISet<OrdenVenta> _OrdenVenta ;
		private System.String _Login;
		private System.String _Nombre;
		private System.String _Pass;
		private System.String _Tipo;



	    public virtual System.String Apellido
		{
			get
			{
				return _Apellido;
			}
			set
			{
				if (value == null)
				{
					throw new BusinessException("ApellidoRequired", "Apellido must not be null.");
				}
				_Apellido = value;
			}
		}

		public virtual System.String Cedula
		{
			get
			{
				return _Cedula;
			}
			set
			{
				_Cedula = value;
			}
		}

		public virtual System.String Direccion
		{
			get
			{
				return _Direccion;
			}
			set
			{
				_Direccion = value;
			}
		}

		public virtual ISet<OrdenCompra> ordenCompra
		{
			get
			{
				return _OrdenCompra;
			}
            set
            {
                _OrdenCompra = value;
            }
		}

		public virtual ISet<OrdenVenta> ordenVenta
		{
			get
			{
				return _OrdenVenta;
			}
            set
            {
                _OrdenVenta = value;
            }
		}

		public virtual System.Int32 Id
		{
			get
			{
				return _Id;
			}
			set
			{
				_Id = value;
			}
		}

		public virtual System.String Login
		{
			get
			{
				return _Login;
			}
			set
			{
				_Login = value;
			}
		}

		public virtual System.String Nombre
		{
			get
			{
				return _Nombre;
			}
			set
			{
				if (value == null)
				{
					throw new BusinessException("NombreRequired", "Nombre must not be null.");
				}
				_Nombre = value;
			}
		}

		public virtual System.String Pass
		{
			get
			{
				return _Pass;
			}
			set
			{
				_Pass = value;
			}
		}

		public virtual System.String Tipo
		{
			get
			{
				return _Tipo;
			}
			set
			{
				if (value == null)
				{
					throw new BusinessException("TipoRequired", "Tipo must not be null.");
				}
				_Tipo = value;
			}
		}


		protected bool Equals(Empleado entity)
		{
			if (entity == null) return false;
			if (!base.Equals(entity)) return false;
			if (!Equals(_Id, entity._Id)) return false;
			return true;
		}

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(this, obj)) return true;
			return Equals(obj as Empleado);
		}

		public override int GetHashCode()
		{
			int result = base.GetHashCode();
			result = 29*result + _Id.GetHashCode();
			return result;
		}

	}
}
